﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MvvmHelper;

namespace MVVMKKSample.UCT
{
    /// <summary>
    /// uctTextBox.xaml の相互作用ロジック
    /// </summary>
    public partial class uctTextBox : UserControl
    {
        public uctTextBox()
        {
            InitializeComponent();
        }
        public String strSub
        {
            get { return (String)GetValue(strSubProperty); }
            set { SetValue(strSubProperty, value); }
        }

        public static readonly DependencyProperty strSubProperty =
            DependencyPropertyHelper<uctTextBox>.Register(_ => _.strSub);



        public string strInput
        {
            get { return (string)GetValue(strInputProperty); }
            set { SetValue(strInputProperty, value); }
        }

        public static readonly DependencyProperty strInputProperty =
            DependencyPropertyHelper<uctTextBox>.Register(_ => _.strInput);



        public string strInfo
        {
            get { return (string)GetValue(strInfoProperty); }
            set { SetValue(strInfoProperty, value); }
        }

        public static readonly DependencyProperty strInfoProperty =
            DependencyPropertyHelper<uctTextBox>.Register(_ => _.strInfo);



        public bool flgReq
        {
            get { return (bool)GetValue(flgReqProperty); }
            set { SetValue(flgReqProperty, value); }
        }

        public static readonly DependencyProperty flgReqProperty =
            DependencyPropertyHelper<uctTextBox>.Register(_ => _.flgReq);



        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (flgReq)
            {
                lblSub.Foreground = Brushes.Blue;
            }
        }
    }
}
